<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>forEach遍历数组</title>
</head>
<body>
  <script>
   const arr=['one','two','three','four','five']
  //  forEach适合遍历数组对象
  const ret=arr.forEach(function(item,index){
     console.log(item)
     console.log(index)
  })
  console.log(ret)
   
  </script>
</body>
</html>